<?php
class ConfirmPictureCtl extends BaseCtl {
	public function ConfirmPictureCtl(){
		parent::BaseCtl();
	}
	
	public function submit(){
		try {
			// get the list
			$form = $this->getConfirmPictureForm();
			$ids = $form->getIds();
	
			// delete them
			$service = new Service();
			$service->deletePictures($ids);
			
			// delete also all the files
			$this->deleteFiles($ids); 
			
			$pform = $this->getPicturesForm();
			$pform->deletePictures($ids);
			$pform->setSelected(array());
			
			$this->redirect('pictures.php');
		}
		catch(Exception $e){
			HtmlUtil::addError($e->getMessage());
		}
	}
	
	public function cancel(){
		try {
			$this->redirect('pictures.php');
		}
		catch(Exception $e){
			HtmlUtil::addError($e->getMessage());
		}
	}
    
	public function isPostback(){
		return 'confirmpicture' == $this->getPost('pagename');
	}

    public function loadData(){
    	// no implementation for this
    }
} 
?>